# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=tracker3-miners
pkgver=3.5.2
pkgrel=1
pkgdesc="Collection of data extractors for Tracker/Nepomuk"
url="https://wiki.gnome.org/Projects/Tracker"
arch=(x86_64)
license=(GPL)
depends=(
  exempi
  giflib
  gst-plugins-base-libs
  libcue
  libexif
  libgexiv2
  libgrss
  libgsf
  libgxps
  libiptcdata
  libnm
  libosinfo
  libseccomp
  poppler-glib
  totem-plparser
  tracker3
  upower
)
makedepends=(
  asciidoc
  git
  meson
)
checkdepends=(
  gst-libav
  gst-plugins-base
  gst-plugins-good
  python-gobject
  python-tappy
)
groups=(gnome)
_commit=eb4b8e1e939b5a01418cac3795e198116968b351  # tags/3.5.2^0
source=("git+https://gitlab.gnome.org/GNOME/tracker-miners.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd tracker-miners
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd tracker-miners
}

build() {
  local meson_options=(
    -D tests_tap_protocol=true
  )

  arch-meson tracker-miners build "${meson_options[@]}"
  meson compile -C build
}

check() {
  # Intermittent test failures: https://gitlab.gnome.org/GNOME/tracker-miners/-/issues/79
  dbus-run-session meson test -C build --print-errorlogs -t 3 || :
}

package() {
  depends+=(libtracker-sparql-3.0.so)

  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
